import { axiosGet, axiosPost, axiosPut, axiosDelete } from '/@/api/RequestBase';
import { SqlSugarPagedList, BaseKeywordPageInput } from '/@/api/BaseDto';

import { BasXueYeChanPinInput } from './dto/BasXueYeChanPinInput';
import { BasXueYeChanPinOutput } from './dto/BasXueYeChanPinOutput';
import { BasXueYeChanPinAllOutput } from './dto/BasXueYeChanPinAllOutput';

export type { BasXueYeChanPinInput, BasXueYeChanPinOutput, BasXueYeChanPinAllOutput, };

const service = 'BasXueYeChanPin/'; // 要写后面的斜杠, 不要写前面的斜杠

export const BasXueYeChanPinApi = {
	page: (data: BaseKeywordPageInput) => {
		return axiosPost<SqlSugarPagedList<BasXueYeChanPinOutput>>(service + 'page', data);
	},
	all: () => {
		return axiosPost<Array<BasXueYeChanPinAllOutput>>(service + 'all', {});
	},
	get: (id: number) => {
		return axiosGet<BasXueYeChanPinOutput>(service + `get/${id}`);
	},
	add: (data: BasXueYeChanPinInput) => {
		return axiosPost<number>(service + 'add', data);
	},
	update: (data: BasXueYeChanPinInput) => {
		return axiosPut<boolean>(service + 'update', data);
	},
};
